//
//  FileUploader.h
//  Ink2Go
//
//  Created by Reisen on 1/13/15.
//
//

#import <Foundation/Foundation.h>

@protocol FileUploaderDelegate
@optional
-(void) uploadFailed:(id)sender;
-(void) uploadCompleted:(id)sender;
-(void) uploadProgress:(float)progress;
@end

@interface UploadInfo : NSObject
{
    
}

@property (assign) long contentLength;
@property (assign) long offset;
@property (strong) NSString* fileName;
@property (strong) NSString* contentPath;
@property (strong) NSString* guid;
@property (strong) NSString* link;
@property (strong) NSString* contentType;

-(id) initWithPath:(NSString*)filePath;

@end

@interface FileUploader : NSObject
{
}

@property (assign) long curProgress;
@property (assign) long maxProgress;
@property (strong) NSString* url;

@property (strong) NSString* username;
@property (assign) long long uId;

@property (strong) NSString* status;
@property (strong) NSString* message;

@property (strong) UploadInfo* clientFileInfo;

@property (strong) NSMutableArray* pendingUploads;

@property (strong) NSMutableArray* pendingUploadDicts;

@property (strong) NSThread* workerThread;

@property (strong) NSString* serverURL;
@property (assign) BOOL isBusy;
@property (assign) BOOL isCancelling;

@property (weak) id<FileUploaderDelegate> delegate;

-(void) uploadFile:(NSString*)filePath;
-(void) uploadFiles:(NSMutableArray*)files;
-(void) uploadFiles:(NSMutableArray*)files threaded:(BOOL)threaded;

-(void) cancel;
-(void) enqueueUpload:(NSString*)oldPath;

@end
